package com.ruoyi.health.service.impl;

import com.ruoyi.health.domain.Family;
import com.ruoyi.health.mapper.FamilyMapper;
import com.ruoyi.health.service.IFamilyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * IFamilyService实现类
 * @author libin
 * @date 2023-8-21
 */
@Service
public class FamilyServiceImpl implements IFamilyService {

    @Autowired
    private FamilyMapper familyMapper;

    @Override
    public Family selectFamilyById(Long id,Long userId) {
        return familyMapper.selectFamilyById(id,userId);
    }

    @Override
    public List<Family> selectFamilyListByUserId(Long userId) {
        return familyMapper.selectFamilyListByUserId(userId);
    }

    @Override
    public int insertFamily(Family family) {
        return familyMapper.insertFamily(family);
    }

    @Override
    public int updateFamily(Family family) {
        return familyMapper.updateFamily(family);
    }

    @Override
    public int deleteFamilyById(Long id) {
        return familyMapper.deleteFamilyById(id);
    }
}
